---
layout: example
category: example
title: Disable map rotation
description: Prevent users from rotating a map.
tags:
  - user-interaction
---
<div id='map'></div>
<script>
var map = new mapboxgl.Map({
    container: 'map', // container id
    style: 'mapbox://styles/mapbox/streets-v9', //stylesheet location
    center: [-122.65, 45.52], // starting position
    zoom: 9 // starting zoom
});

// disable map rotation using right click + drag
map.dragRotate.disable();

// disable map rotation using touch rotation gesture
map.touchZoomRotate.disableRotation();
</script>
